/**
 * @param {Array} list 标签列表
 * @param {String} name 当前关闭的标签的name
 */
export const getNextName = (list, name) => {
    let res = '';
    if (list.length === 2) {
        res = '首页';
    } else {
        if (list.findIndex(item => item.name === name) === list.length - 1) res = list[list.length - 2].name
        else res = list[list.findIndex(item => item.name === name) + 1].name
    }
    return res;
};
export const addTag = (newRoute,tagList) =>{
    if(tagList.findIndex(item => newRoute.name === item.name) < 0){
        tagList.push({name:newRoute.name,path:newRoute.path});
    };
    localStorage.setItem('tagNaveList',JSON.stringify(tagList));
};